package com.song.tools.songtest.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.song.tools.log.systemlog.core.LogTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * <p>
 * 系统日志表
 * </p>
 *
 * @author song tools
 * @since 2024-07-16
 */
@Getter
@Setter
@TableName("system_log")
@Schema(name = "SystemLog", description = "系统日志表")
public class SystemLog implements Serializable {
    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "日志唯一值")
    private String logId;

    @Schema(description = "操作ip")
    private String requestIp;

    @Schema(description = "日志类型:error=错误日志,info=正常日志")
    private LogTypeEnum logType;

    @Schema(description = "操作描述")
    private String description;

    @Schema(description = "类路径")
    private String classPath;

    @Schema(description = "方法名")
    private String actionMethod;

    @Schema(description = "请求类型，比如GET、POST等")
    private String httpMethod;

    @Schema(description = "请求报文")
    private String requestParam;

    @Schema(description = "响应报文")
    private String responseParam;

    @Schema(description = "请求路径")
    private String requestUri;

    @Schema(description = "开始时间")
    private LocalDateTime startTime;

    @Schema(description = "结束时间")
    private LocalDateTime endTime;

    @Schema(description = "耗时（单位：毫秒）")
    private Long costTime;

    @Schema(description = "错误信息")
    private String error;

    @Schema(description = "创建人")
    private String createUser;

    @Schema(description = "创建人ID")
    private String createUserId;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;
}
